package com.example.demo.services

import com.example.demo.entity.CarInfoEntity
import com.example.demo.entity.LoginEntity
import com.example.demo.entity.RouteEntity
import com.example.demo.entity.TreeEntity
import org.springframework.cloud.openfeign.FeignClient
import org.springframework.stereotype.Service
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestParam
@Service
@FeignClient(url = "\${proxyUrl.url}", name = "api")
interface ProxyService {
    /**
     * 登录接口
     */
    @GetMapping(value = ["Login"])
    fun login(@RequestParam("username") username: String, @RequestParam("password") password: String): LoginEntity

    /**
     *  获取属性结构
     */
    @GetMapping(value = ["getTree"])
    fun getTree(@RequestParam("GroupID") GroupID: String): TreeEntity

    /**
     * 获取 车辆信息
     */
    @GetMapping(value = ["getData"])
    fun getData(@RequestParam("carstring") carstring: String): List<CarInfoEntity>

    /**
     * 获取路线
     */
    @GetMapping(value = ["getRoutes"])
    fun getRoutes(@RequestParam("CarNo") CarNo: String,
                  @RequestParam("starttime") starttime: String,
                  @RequestParam("endtime") endtime: String
    ): List<RouteEntity>
}